<?php /* Smarty version 2.6.26, created on 2018-07-20 02:57:16
         compiled from E:%5CWWW%5C40.125.208.171%5Cvweb/admin%5Ctemplates/area/index.html */ ?>
<?php $_smarty_tpl_vars = $this->_tpl_vars;
$this->_smarty_include(array('smarty_include_tpl_file' => "index/header.html", 'smarty_include_vars' => array()));
$this->_tpl_vars = $_smarty_tpl_vars;
unset($_smarty_tpl_vars);
 ?>
<div class="nav"><span>地区管理</span></div>
<div class="main"> 
	<div class="menu"> 
		<label>
			<span>省份：</span>
			<label><select name="province" id="province">
				<option value="0">--请选择--</option> 
			<?php $_from = $this->_tpl_vars['provinceData']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }if (count($_from)):
    foreach ($_from as $this->_tpl_vars['p']):
?>
					<option value="<?php echo $this->_tpl_vars['p']['id']; ?>
" <?php if ($_GET['prov'] == $this->_tpl_vars['p']['id']): ?>selected="selected"<?php endif; ?>><?php echo $this->_tpl_vars['p']['name']; ?>
</option>
			<?php endforeach; endif; unset($_from); ?> 
			</select></label>
		</label>
		<label>
			<span>市区：</span>
			<label><select name="city" id="city">
				<option value="0">--请选择--</option>
			<?php if ($this->_tpl_vars['data']): ?> 
				<?php $_from = $this->_tpl_vars['cityData']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }if (count($_from)):
    foreach ($_from as $this->_tpl_vars['c']):
?>
					<option value="<?php echo $this->_tpl_vars['c']['id']; ?>
" <?php if ($_GET['pid'] == $this->_tpl_vars['c']['id']): ?>selected="selected"<?php endif; ?>><?php echo $this->_tpl_vars['c']['name']; ?>
</option>
				<?php endforeach; endif; unset($_from); ?> 
			<?php endif; ?>
			</select> </label>
		</label>
	</div>
	<table width="100%" class="ltable">
	  	<thead>
		  	<tr> 
				<th width="300">地区名</td> 
				<th width="100">首字母</th> 
				<th width="100">首字母</th> 
				<th width="150">操作</th>
				<th></th> 
		  	</tr>
	  	</thead>
		<tbody>
	<?php if ($this->_tpl_vars['data']): ?>
		<?php $_from = $this->_tpl_vars['data']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }if (count($_from)):
    foreach ($_from as $this->_tpl_vars['i']):
?>
		<tr> 
			<td><?php echo $this->_tpl_vars['i']['name']; ?>
</td> 
			<td><?php if ($this->_tpl_vars['i']['letter'] == ''): ?><?php else: ?><?php echo $this->_tpl_vars['i']['letter']; ?>
<?php endif; ?></td> 
			<td><?php if ($this->_tpl_vars['i']['status'] == '1'): ?>正常<?php else: ?>关闭<?php echo $this->_tpl_vars['i']['status']; ?>
<?php endif; ?></td> 
			<td>
				<a href="javascript:;" onClick="update_menu('地区设置','?m=area&a=edit&id=<?php echo $this->_tpl_vars['i']['id']; ?>
');" class="edit">修改</a> 
				<a href="?m=district&a=del&id=<?php echo $this->_tpl_vars['i']['id']; ?>
" class="del">删除</a>
			</td> 
			<td></td>
		</tr>
		<?php endforeach; endif; unset($_from); ?>
	<?php else: ?>
	  	<tr>
			<td colspan="5">暂时无地区</td>
	  	</tr>
	<?php endif; ?>
		</tbody>  
	</table> 
</div>
<?php $_smarty_tpl_vars = $this->_tpl_vars;
$this->_smarty_include(array('smarty_include_tpl_file' => "index/footer.html", 'smarty_include_vars' => array()));
$this->_tpl_vars = $_smarty_tpl_vars;
unset($_smarty_tpl_vars);
 ?>
<script type="text/javascript">
function add_menu(name,url){  
	parent.dialog(name,url); 
}
function update_menu(name,url){
	parent.dialog(name,url,400); 
}
function syn_weixin(url){
	parent.ajax_alert(url);
}
$(function(){
	$("#chk_cs").change(function(){
		var as = $(this).val(); 
		location.href="?m=area&a=index&cid="+as; 
	});
});
function delete_submit(){
	if(confirm("确定要删除吗?"))
	return true;
	else
	return false;
} 
$(function(){
	$("#province").change(function(){ 
		var pid=$(this).children('option:selected').val();
		location.href="?m=area&a=index&prov="+pid+"&pid="+pid;
	});
	$("#city").change(function(){ 
		var city=$(this).children('option:selected').val();
		location.href="?m=area&a=index&prov=<?php echo $_GET['prov']; ?>
&city="+city+"&pid="+city;
	});
});
</script> 